package com.study.array;

import java.util.Arrays;

/**
 * @author ytj
 * @date 2021/12/29
 */
public class Method11 {
    public static void main(String[] args) {
        String test="Let's take LeetCode contest";
        System.out.println(reverseWords(test));
    }

    public static String reverseWords(String s) {
        StringBuilder stringBuilder=new StringBuilder();
        String[] array=s.split(" ");
        for (int i = 0; i < array.length; i++) {
            String temp=array[i];
            stringBuilder.append(new StringBuilder(temp).reverse()).append(" ");
        }
        return stringBuilder.toString().trim();
    }
}
